Coding by Knox Jason

Coding by Knox Jason
Author: Knox, Jason
Language: eng
Format: epub
Published: 2019-12-26

The solution is to roll these two lines of code with another "try" block, "except", where we specify the error we want to capture, as it was done in the previous case, with the difference that now we are capturing two lines of codes and then we generate and execute the code.

For a code to be executed, we always have the alternative of introducing the code inside a "finally" clause, if an exception is captured or not when applying the "finally" clause, there is no need for there to be any "except".

Now, no matter what happens inside "try", the "finally" instruction will always be executed, whether something good happens or not.